package util

import "sync"

type IntCounter struct {
	i  int
	mx sync.RWMutex
}

func (c *IntCounter) Inc() {
	c.mx.Lock()
	defer c.mx.Unlock()
	c.i++
}

func (c *IntCounter) Get() int {
	c.mx.RLock()
	defer c.mx.RUnlock()
	return c.i
}
